{% extends "myapp/hat.html" %}
{% load crispy_forms_filters %}

{% load crispy_forms_tags %}

{% block content %}

    <div class="container">

    {% if families.count > 0 %}
    <h2>Список Семейств</h2>
    <table class="table">
    <thead>
        <tr>
            <th scope="col" class="col-4">Name</th>
            <th scope="col">Rule</th>
        </tr>
    </thead>
        {% for family in families %}
            {% if user.id == family.userId and family.isActive %}
            <tr><td class="">{{ family.name }}</td><td class="">{{ family.rule }}</td></tr>
                <tr>
                    <td><a href="/families/{{family.id}}">Выбрать</a></td>
                    <td><a href="/family_delete/{{family.id}}">Удалить</a></td></tr>
            {% endif %}
        {% endfor %}
    </table>
    {% endif %}
    </div>
{% endblock %}